package model.game.maze;

import model.algorithms.State;

public class MazeState extends State {
	private int x;
	private int y;
	
	public MazeState() {
	}
	
	public MazeState(int x, int y) {
		this.x = x;
		this.y = y;
	}

	public int getX() {
		return x;
	}

	public void setX(int x) {
		this.x = x;
	}

	public int getY() {
		return y;
	}

	public void setY(int y) {
		this.y = y;
	}
	
	public void addToX(int x) {
		this.x += x;
	}
	
	public void addToY(int y) {
		this.y += y;
	}
	
	@Override
	public boolean equals(Object obj) {
		if (!(obj instanceof MazeState)) {
			return false;
		}
		
		MazeState other = (MazeState)obj;
		return (this.x == other.getX() && this.y == other.getY());
	}
	
	@Override
	public int hashCode() {
		return (Integer.toString(x) + Integer.toString(y)).hashCode();
	}
}
